﻿-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
USE [WarehouseManagement]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		AnhDQ
-- Create date: 3/22/2011
-- Description:	This stored procedure use to insert an Employment Type record
-- =============================================
ALTER PROCEDURE [InsertEmploymentType]
(
@EmploymentTypeID INT,
@EmploymentTypeCode VARCHAR(10),
@EmploymentType NVARCHAR(50), 
@BriefDescription NVARCHAR(500),
@FullDescription NVARCHAR(MAX)
)
AS
BEGIN
	
	IF (NOT EXISTS(SELECT 1 FROM [EmploymentType] WHERE [EmploymentType] = @EmploymentType OR EmploymentTypeCode = @EmploymentTypeCode))
	BEGIN
		INSERT INTO EmploymentType 
		(
				EmploymentType ,
				EmploymentTypeCode ,
				[BriefDescription] ,
				[FullDescription]
		) 
		VALUES
		(
				@EmploymentTypeCode ,
				@EmploymentType , 
				@BriefDescription ,
				@FullDescription 
		)
	END		
END

/*
USE WarehouseManagement
GO

EXEC [InsertEmploymentType] @EmploymentType = 'Test',
							@Description = 'aaaaaaaaaaaaaa'
*/


